package br.com.spam.pipeline.iu;

import javax.swing.JFileChooser;
import javax.swing.JFrame;

@SuppressWarnings("serial")
public class FileChooser extends JFileChooser
{
	private JFrame parent;

	public FileChooser(JFrame parent, String title)
	{
		this.setDialogTitle("Código-Fonte");
		this.parent = parent;
	}

	public String go()
	{
		this.setVisible(true);
		int returnVal = this.showOpenDialog(this.parent);
		if (returnVal == JFileChooser.APPROVE_OPTION) { return this.getSelectedFile().getPath(); }
		return null;
	}

}
